#!/usr/bin/perl

require "./mailadmin-lib.pl";
&ReadParse();

my (%dft_uinfo, $msg_over_batnum);

unless (&qmail_dir_check())
{
    &redirect('maildir_edit.cgi');
}

$msg_over_batnum = &text('msg_over_bataction_num', $config{'bataction_num'});

&header($text{'index_title'}, "", undef, 0, 1);

print "<form action=save_create_domain.cgi name=crtdform method=post onsubmit=\'return do_submit();\'>\n";

print "<table class=mode1 border=0 width=100%>\n";

print "<tr><td width=15%>$text{'dname'}</td><td><input name=dname class=text value=\"\"></td></tr>\n";

print "<tr><td>$text{'password'}</td><td><input name=passwd class=text type=password value=\"\"></td></tr>\n";
print "<tr><td>$text{'confirm_pw'}</td><td><input name=con_passwd class=text type=password value=\"\"></td></tr>\n";

print "</table>\n";

print "<p><input type=submit name=btn_create class=button1 value=\"$text{'btn_create'}\" onclick=\'return create_domain();\'>";

print "</form>\n";

print <<EOF;
<script>
function do_submit()
{
    document.forms[0].btn_create.disabled = true;
}

function create_domain()
{
    if (document.crtdform.dname.value == "")
    {
	alert("$text{'msg_dname_empty'}");
	return false;
    }

    if (document.crtdform.passwd.value != document.crtdform.con_passwd.value)
    {
	alert("$text{'msg_conpasswd_diff'}");
	return false;
    }
}

</script>
EOF


&footer("list_domain.cgi", $text{"back_lsdomain"});
